package com.woniu.learnasync.controller;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * created by woniu201
 * created in 2018/7/6
 */
@Component
public class Task {

    @Async
    public void task1() throws InterruptedException {
        long t1 = System.currentTimeMillis();
        Thread.sleep(1000);
        long t2 = System.currentTimeMillis();
        System.out.println("耗时：" + (t2-t1));
    }
}
